﻿<div class="tnc-dailog-pd">
    <div class="tnc-upload-attach">
        <div class="tn-form tn-label-right">
            <div class="tn-form-row">
                <label class="tn-form-label">
                    网络图片：</label>
                @Html.TextBox("netImageUrl", null, InputWidthTypes.Long, null)
            </div>
            <div class="tn-form-row">
                <label class="tn-form-label">
                </label>
                <span class="tn-text-note">例如：http://img.spacebuilder.cn/photo/9275.jpg </span>
            </div>
        </div>
    </div>
</div>
<div class="tnc-artdilog-btn tn-bg-gray tn-border-gray tn-border-top">
    @Html.Button("插入", ButtonTypes.Submit, HighlightStyles.Primary, htmlAttributes: new { id = "insertNetUrl", dialogOperation = "close" })
    @Html.Button("关闭", ButtonTypes.Cancel, HighlightStyles.Secondary, htmlAttributes: new { id = "cancelNetUrl", dialogOperation = "close" })
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#insertNetUrl").click(function () {
            var imageUrl = $("#netImageUrl").val();
            var $tinyMCE = $('#' + tinyMCE.activeEditor.id);
            if (imageUrl) {
                $tinyMCE.insertContentToEditor('<img src="' + imageUrl + '" />');
                $("#netImageUrl").attr("value", '');

            }
            else {
                art.dialog.tips('请填写图片URL！', 1.5, -1);
            }
        });

    });
</script>